package com.example.book_subscribe.mine.controlle;

import com.example.book_subscribe.bookList.mapper.BookListMapper;
import com.example.book_subscribe.bookList.result.BookResult;
import com.example.book_subscribe.mine.dto.NoteDetailDto;
import com.example.book_subscribe.mine.mapper.MineMapper;
import com.example.book_subscribe.mine.result.MineResult;
import com.example.book_subscribe.mine.result.MyCommentResult;
import com.example.book_subscribe.mine.result.MySubscribeResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;

@RestController
public class MineControlle {
    @Resource
    private MineMapper mineMapper;
    @GetMapping("/getMine")
    public MineResult getMine(@RequestParam String openid) {
        MineResult results = mineMapper.searchMine(openid);
        return results;
    }
    @GetMapping("/getMySubscribe")
    public ArrayList<MySubscribeResult> getMySubscribe(@RequestParam String openid) {
        ArrayList<MySubscribeResult> results = mineMapper.getMySubscribe(openid);
        return results;
    }
    @GetMapping("/getMyComment")
    public ArrayList<MyCommentResult> getMyComment(@RequestParam String openid) {
        ArrayList<MyCommentResult> results = mineMapper.getMyComment(openid);
        return results;
    }
    @GetMapping("/getNoteList")
    public ArrayList<BookResult> getNoteList(@RequestParam String openid) {
        ArrayList<BookResult> results = mineMapper.getNoteList(openid);
        return results;
    }
    @PostMapping("/getNoteDetail")
    public String getNoteDetail(@RequestBody NoteDetailDto NoteDetail) {
        String results = mineMapper.getNoteDetail(NoteDetail);
        return results;
    }
}
